import axios from './http'
// 推荐歌单
export function commend() {
    return axios.get("/music-api/personalized?limit=6")
}
// 最新音乐
export function newest() {
    return axios.get("/music-api/personalized/newsong")
}
// 排行榜
export function rank() {
    return axios.get("/music-api/toplist/detail?limit=4")
}
// 获取推荐歌单详情
export function getSongListDetails (id) {
    return axios.get(`/music-api/playlist/detail?id=${id}`)
}
// 获取歌曲详情
export function getSongDetails (ids) {
    return axios.get(`/music-api/song/detail?ids=${ids}`)
}
// 获取新歌榜
export function getNewSongList () {
    return axios.get(`/music-api/personalized/newsong`)
}
// 获取歌词
export function getLyrics (id) {
    return axios.get(`/music-api/lyric?id=${id}`)
}
// 登录
export function login(username, password) {
    let form = new FormData()
    form.append("username", username)
    form.append("rememberMe", true)
    form.append("password", password)
    return axios.post(`/userapi/api/login`, form)
}
// 查看个人信息
export function userInfo() {
    return axios.get(`/userapi/api/login-user/info`)
}
// 退出登录
export function logout() {
    return axios.get(`/userapi/api/logout`)
}
